#include "protoolsstandard.h"
#include <QFile>
#include <QTextStream>
#include <QStringList>
#include <QtGui>

ProtoolsStandard::ProtoolsStandard()
{
    ProductionSize = ProtoolsStandard::SMALL_CONCERT;

    Artists = new QList<Artist *>;

    Venues = new QList<Venue *>;

    PerformanceDates = new QList<PerformanceDate *>;

    Taxes = new QList<Tax *>;

    TicketTiers = new QList<Ticket *>;

    Main_lblSize = "";

    Main_lblVenues = "";

    Main_lblArtists = "";

    Main_lblPerformaceDates = "";

    Main_lblProdCost = "";

    Main_lblStaffCost = "";

    Main_lblAdminCosts = "";

    Main_lblMktgCosts = "";

    Main_lblSecCosts = "";

    Main_lblOpsCost = "";

    Main_lblSubTotal = "";

    Main_lblTicketSalesPos = "";

    Main_lblPossibleDollars = "";

    Main_lblPossibleTicletCOmm = "";

    Main_lblTax = "";

    Main_lblNet = "";
}

ProtoolsStandard::~ProtoolsStandard()
{
    for (int i = 0; i < this->Artists->count(); i++)
    {
        Artist *a = this->Artists->at(i);
        this->Artists->removeAt(i);
        delete a;
    }

    delete Artists;

    for (int i = 0; i < this->Venues->count(); i++)
    {
        Venue *v = this->Venues->at(i);
        this->Venues->removeAt(i);
        delete v;
    }

    delete Venues;

    for (int i = 0; i < this->PerformanceDates->count(); i++)
    {
        PerformanceDate *p = this->PerformanceDates->at(i);
        this->PerformanceDates->removeAt(i);
        delete p;
    }

    delete PerformanceDates;

    for (int i = 0; i < this->Taxes->count(); i++)
    {
        Tax *t = this->Taxes->at(i);
        this->Taxes->removeAt(i);
        delete t;
    }

    delete Taxes;

    for (int i = 0; i < this->TicketTiers->count(); i++)
    {
        Ticket *t = this->TicketTiers->at(i);
        this->TicketTiers->removeAt(i);
        delete t;
    }

    delete TicketTiers;
}

// We will need to do something else here...?
QString castring(const QString &string)
{
    return string;
}

void ProtoolsStandard::WriteFile(const QString &fileName)
{
    QFile data(fileName);

     if (data.open(QFile::WriteOnly | QFile::Truncate))
     {
         QTextStream out(&data);

         // This is the show size.
         out << "ProductionSize:" << this->ProductionSize;
         out << "\n";

         // This is for the admin
         out << "AdminScreen_AdminStaff:" << this->AdminScreen_AdminStaff;
         out << "\n";
         out << "AdminScreen_ASCAP:" << this->AdminScreen_ASCAP;
         out << "\n";
         out << "AdminScreen_BoxOffStaff:" << this->AdminScreen_BoxOffStaff;
         out << "\n";
         out << "AdminScreen_Insurance:" << this->AdminScreen_Insurance;
         out << "\n";
         out << "AdminScreen_LegalAccountant:" <<  this->AdminScreen_LegalAccountant;
         out << "\n";
         out << "AdminScreen_OfficeCosts:" << this->AdminScreen_OfficeCosts;
         out << "\n";
         out << "AdminScreen_OfficeEquipment:" << this->AdminScreen_OfficeEquipment;
         out << "\n";
         out << "AdminScreen_Permits:" << this->AdminScreen_Permits;
         out << "\n";
         out << "AdminScreen_Phones:" << this->AdminScreen_Phones;
         out << "\n";
         out << "AdminScreen_Postage:" << this->AdminScreen_Postage;
         out << "\n";
         out << "AdminScreen_RentPower:" << this->AdminScreen_RentPower;
         out << "\n";
         out << "AdminScreen_Ticketprinting:" << this->AdminScreen_Ticketprinting;
         out << "\n";
         out << "AdminScreen_TicketTakers:" << this->AdminScreen_TicketTakers;
         out << "\n";
         out << "AdminScreen_TrafficControl:" << this->AdminScreen_TrafficControl;
         out << "\n";

         //This is for our main screen.
         out << "Main_lblAdminCosts:" << this->Main_lblAdminCosts;
         out << "\n";
         out << "Main_lblArtists:" << this->Main_lblArtists;
         out << "\n";
         out << "Main_lblMktgCosts:" << this->Main_lblMktgCosts;
         out << "\n";
         out << "Main_lblNet:" << this->Main_lblNet;
         out << "\n";
         out << "Main_lblOpsCost:" << this->Main_lblOpsCost;
         out << "\n";
         out << "Main_lblPerformaceDates:" << this->Main_lblPerformaceDates;
         out << "\n";
         out << "Main_lblPossibleDollars:" << this->Main_lblPossibleDollars;
         out << "\n";
         out << "Main_lblPossibleTicletCOmm:" << this->Main_lblPossibleTicletCOmm;
         out << "\n";
         out << "Main_lblProdCost:" << this->Main_lblProdCost;
         out << "\n";
         out << "Main_lblSecCosts:" << this->Main_lblSecCosts;
         out << "\n";
         out << "Main_lblSize:" << this->Main_lblSize;
         out << "\n";
         out << "Main_lblStaffCost:" << this->Main_lblStaffCost;
         out << "\n";
         out << "Main_lblSubTotal:" << this->Main_lblSubTotal;
         out << "\n";
         out << "Main_lblTax:" << this->Main_lblTax;
         out << "\n";
         out << "Main_lblTicketSalesPos:" << this->Main_lblTicketSalesPos;
         out << "\n";
         out << "Main_lblVenues:" << this->Main_lblVenues;
         out << "\n";

         // This is for the marketing.
         out << "MarketingScreen_CreativePrinting:" << this->MarketingScreen_CreativePrinting;
         out << "\n";
         out << "MarketingScreen_MktgStaff:" << this->MarketingScreen_MktgStaff;
         out << "\n";
         out << "MarketingScreen_PublicRelations:" << this->MarketingScreen_PublicRelations;
         out << "\n";

         // This is for the operations.
         out << "OperationsScreen_EquipmentRent:" << this->OperationsScreen_EquipmentRent;
         out << "\n";
         out << "OperationsScreen_Fence:" << this->OperationsScreen_Fence;
         out << "\n";
         out << "OperationsScreen_Kamode:" << this->OperationsScreen_Kamode;
         out << "\n";
         out << "OperationsScreen_Laborers:" << this->OperationsScreen_Laborers;
         out << "\n";
         out << "OperationsScreen_LandPrep:" << this->OperationsScreen_LandPrep;
         out << "\n";
         out << "OperationsScreen_LandRestore:" << this->OperationsScreen_LandRestore;
         out << "\n";
         out << "OperationsScreen_MotorHomes:" << this->OperationsScreen_MotorHomes;
         out << "\n";
         out << "OperationsScreen_OpsVehicles:" << this->OperationsScreen_OpsVehicles;
         out << "\n";
         out << "OperationsScreen_PerimeterLights:" << this->OperationsScreen_PerimeterLights;
         out << "\n";
         out << "OperationsScreen_Petroleum:" << this->OperationsScreen_Petroleum;
         out << "\n";
         out << "OperationsScreen_PowerGenerator:" << this->OperationsScreen_PowerGenerator;
         out << "\n";
         out << "OperationsScreen_ShuttleBuses:" << this->OperationsScreen_ShuttleBuses;
         out << "\n";
         out << "OperationsScreen_SiteOpsCoordinator:" << this->OperationsScreen_SiteOpsCoordinator;
         out << "\n";
         out << "OperationsScreen_VenueCost:" << this->OperationsScreen_VenueCost;
         out << "\n";
         out << "OperationsScreen_WaterTrucks:" << this->OperationsScreen_WaterTrucks;
         out << "\n";

         // This is for the production stuff.
         out << "ProductionScreen_Aerials:" << this->ProductionScreen_Aerials;
         out << "\n";
         out << "ProductionScreen_Catering:" << this->ProductionScreen_Catering;
         out << "\n";
         out << "ProductionScreen_Lights:" << this->ProductionScreen_Lights;
         out << "\n";
         out << "ProductionScreen_Sound:" << this->ProductionScreen_Sound;
         out << "\n";
         out << "ProductionScreen_Stage:" << this->ProductionScreen_Stage;
         out << "\n";
         out << "ProductionScreen_Talent:" << this->ProductionScreen_Talent;
         out << "\n";
         out << "ProductionScreen_LightTowers:" << this->ProductionScreen_LightTowers;
         out << "\n";

         // this is setting some stuff off our object.
         out << "StaffScreen_ProdStaff:" << this->StaffScreen_ProdStaff;
         out << "\n";
         out << "StaffScreen_StageHands:" << this->StaffScreen_StageHands;
         out << "\n";

         // This is our security stuff.
         out << "SecurityScreen_Communications:" << this->SecurityScreen_Communications;
         out << "\n";
         out << "SecurityScreen_FirstAid:" << this->SecurityScreen_FirstAid;
         out << "\n";
         out << "SecurityScreen_Ids:" << this->SecurityScreen_Ids;
         out << "\n";
         out << "SecurityScreen_SecStaff:" << this->SecurityScreen_SecStaff;
         out << "\n";
         out << "SecurityScreen_Vehicles:" << this->SecurityScreen_Vehicles;
         out << "\n";

         out << "TicketComm:" << this->TicketComm;
         out << "\n";

         // This is for the Artists.
         for (int i = 0; i < this->Artists->count(); i++)
         {
             out << "Artist:\n";
             Artist *a = this->Artists->at(i);
             out << "ArtistName:" << a->ArtistName;
             out << "\n";
             out << "EndArtist:";
             out << "\n";
         }

         // This is for the PerformanceDates.
         for (int i = 0; i < this->PerformanceDates->count(); i++)
         {
             out << "Performance Date:\n";
             PerformanceDate *a = this->PerformanceDates->at(i);
             out << "PerformanceStartDateTime:" << a->PerformanceStartDateTime.toString();
             out << "\n";
             out << "PerformanceEndDateTime:" << a->PerformanceEndDateTime.toString();
             out << "\n";
             out << "EndPerf:";
             out << "\n";
         }

         // This is for the TicketTiers.
         for (int i = 0; i < this->TicketTiers->count(); i++)
         {
             out << "Ticket:\n";
             Ticket *a = this->TicketTiers->at(i);
             out << "TierName:" << a->TierName;
             out << "\n";
             out << "TierDescription:" << a->TierDescription;
             out << "\n";
             out << "Cost:" << a->Cost;
             out << "\n";
             out << "NumberAvailable:" << a->NumberAvailable;
             out << "\n";
             out << "EndTicket:";
             out << "\n";
         }

         // This is for the Taxes.
         for (int i = 0; i < this->Taxes->count(); i++)
         {
             out << "Tax:\n";
             Tax *a = this->Taxes->at(i);
             out << "TaxName:" << a->TaxName;
             out << "\n";
             out << "TaxRate:" << a->TaxRate;
             out << "\n";
             out << "EndTax:";
             out << "\n";
         }

         // This is for the Venues.
         for (int i = 0; i < this->Venues->count(); i++)
         {
             out << "Venue:\n";
             Venue *a = this->Venues->at(i);
             out << "VenueAddress1:" << a->VenueAddress1;
             out << "\n";
             out << "VenueAddress2:" << a->VenueAddress2;
             out << "\n";
             out << "VenueAddress3:" << a->VenueAddress3;
             out << "\n";
             out << "VenueCity:" << a->VenueCity;
             out << "\n";
             out << "VenueName:" << a->VenueName;
             out << "\n";
             out << "VenuePostalCode:" << a->VenuePostalCode;
             out << "\n";
             out << "VenueState:" << a->VenueState;
             out << "\n";
             out << "VenueSpecialNotes:" << a->VenueSpecialNotes;
             out << "\n";
             out << "EndVenue:";
             out << "\n";
         }

         out.flush();
         data.close();
     }
}

void ProtoolsStandard::AddArtist(const QString &artistName)
{
    Artist *a = new Artist;
    a->ArtistName = artistName;
    this->Artists->append(a);
}

void ProtoolsStandard::RemoveArtist(int intArtist)
{
    Artist *a = this->Artists->at(intArtist);
    this->Artists->removeAt(intArtist);
    delete a;
}

void ProtoolsStandard::AddVenue(const QString &venueName, const QString &venueAddress1, const QString venueAddress2, const QString venueAddress3, const QString venueCity, const QString venueState, const QString venuePostalCode, const QString venueSpecialNotes)
{
    Venue *v = new Venue;
    v->VenueName = venueName;
    v->VenueAddress1 = venueAddress1;
    v->VenueAddress2 = venueAddress2;
    v->VenueAddress3 = venueAddress3;
    v->VenueCity = venueCity;
    v->VenueName = venueName;
    v->VenuePostalCode = venuePostalCode;
    v->VenueSpecialNotes = venueSpecialNotes;
    v->VenueState = venueState;
    this->Venues->append(v);
}

void ProtoolsStandard::RemoveVenue(int intVenue)
{
    Venue *v = this->Venues->at(intVenue);
    this->Venues->removeAt(intVenue);
    delete v;
}

void ProtoolsStandard::AddPerformanceDate(const QDateTime &startDate, const QDateTime &endDate)
{
    PerformanceDate *pd = new PerformanceDate;
    pd->PerformanceStartDateTime = startDate;
    pd->PerformanceEndDateTime = endDate;
    this->PerformanceDates->append(pd);
}

void ProtoolsStandard::RemovePerformanceDate(int intDateTime)
{
    PerformanceDate *pd = this->PerformanceDates->at(intDateTime);
    this->PerformanceDates->removeAt(intDateTime);
    delete pd;
}

void ProtoolsStandard::AddTicket(const QString &tierName, double cost, const QString &tierDescription, int numberAvailable)
{
    Ticket *t = new Ticket;
    t->TierName = tierName;
    t->Cost = cost;
    t->NumberAvailable = numberAvailable;
    t->TierDescription = tierDescription;
    this->TicketTiers->append(t);
}

void ProtoolsStandard::RemoveTicket(int intTicket)
{
    Ticket *t = this->TicketTiers->at(intTicket);
    this->TicketTiers->removeAt(intTicket);
    delete t;
}

void ProtoolsStandard::AddTax(const QString &taxName, const double &taxRate)
{
    Tax *tax = new Tax;
    tax->TaxName = taxName;
    tax->TaxRate = taxRate;
    this->Taxes->append(tax);
}

void ProtoolsStandard::RemoveTax(int intTax)
{
    Tax *t = this->Taxes->at(intTax);
    this->Taxes->removeAt(intTax);
    delete t;
}

QString ProtoolsStandard::GetTicketText(int currentRow)
{
    Ticket *t = this->TicketTiers->at(currentRow);
    QString s = castring("Tier Name: ");
    s.append(t->TierName);
    s.append(castring("\n"));
    s.append(castring("Description: "));
    s.append(t->TierDescription);
    s.append(castring("\n"));
    s.append(castring("Cost: "));
    s.append(QString::number(t->Cost));
    s.append(castring("\n"));
    s.append(castring("Number Available: "));
    s.append(QString::number(t->NumberAvailable));
    s.append(castring("\n"));
    return s;
}

QString ProtoolsStandard::GetArtistText(int currentRow)
{
    Artist *t = this->Artists->at(currentRow);
    QString s = castring("Name: ");
    s.append(t->ArtistName);
    s.append(castring("\n"));
    return s;
}

QString ProtoolsStandard::GetVenueText(int currentRow)
{
    Venue *t = this->Venues->at(currentRow);
    QString s = castring("Name: ");
    s.append(t->VenueName);
    s.append(castring("\n"));
    s.append(castring("Address 1: "));
    s.append(t->VenueAddress1);
    s.append(castring("\n"));
    s.append(castring("Address 2: "));
    s.append(t->VenueAddress2);
    s.append(castring("\n"));
    s.append(castring("Address 3: "));
    s.append(t->VenueAddress3);
    s.append(castring("\n"));
    s.append(castring("City: "));
    s.append(t->VenueCity);
    s.append(castring("\n"));
    s.append(castring("Postal Code: "));
    s.append(t->VenuePostalCode);
    s.append(castring("\n"));
    s.append(castring("State: "));
    s.append(t->VenueState);
    s.append(castring("\n"));
    s.append(castring("Special Note: "));
    s.append(t->VenueSpecialNotes);
    s.append(castring("\n"));
    return s;
}

QString ProtoolsStandard::GetTaxText(int currentRow)
{
    Tax *t = this->Taxes->at(currentRow);
    QString s = castring("Name: ");
    s.append(t->TaxName);
    s.append(castring("\n"));
    s.append(castring("Rate: "));
    s.append(QString::number(t->TaxRate));
    s.append(castring("\n"));
    return s;
}

QString ProtoolsStandard::GetPerformanceDateText(int currentRow)
{
    PerformanceDate *t = this->PerformanceDates->at(currentRow);
    QString s = castring("Start Date and Time: ");
    s.append(t->PerformanceStartDateTime.toString(Qt::SystemLocaleLongDate));
    s.append(castring("\n"));
    s.append(castring("End Date and Time: "));
    s.append(t->PerformanceEndDateTime.toString(Qt::SystemLocaleLongDate));
    s.append(castring("\n"));
    return s;
}

QStringList ProtoolsStandard::GenerateHTML()
{
    QStringList retHTML;
    retHTML.append("<table width = \"100%\" border = 1 cellspacing = 0>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Main");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    // This is the show size.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Production Size");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblSize);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Adminitsrative Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblAdminCosts);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Marketing Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblMktgCosts);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Operations Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblOpsCost);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Production Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblProdCost);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Security Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblSecCosts);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Production Staff");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblStaffCost);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Subtotal Of Overhead");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblSubTotal);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Possible Number of Tickets");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblTicketSalesPos);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Possible Dollars");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblPossibleDollars);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Taxes Rate");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblTax);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Ticket Commission");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblPossibleTicletCOmm);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Net: ");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(this->Main_lblNet);
    retHTML.append("</td>");
    retHTML.append("</tr>");

    // This is for the admin
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Administrative Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Administrative Staff");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_AdminStaff, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("ASCAP, BMI, SESAC");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_ASCAP, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Box Office Staff");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_BoxOffStaff, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Insurance and Bonding");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_Insurance, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Legal Accountant");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_LegalAccountant, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Office Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_OfficeCosts, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Computers /Office Equipment");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_OfficeEquipment, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Permits and Licenses");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_Permits, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Telecommunications (Phone)");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_Phones, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Postage");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_Postage, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Office Rent, Power, Lights");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_RentPower, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Ticket Printing");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_Ticketprinting, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Ticket Takers");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_TicketTakers, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Traffic Control");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->AdminScreen_TrafficControl, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");


    // This is for the marketing.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Marketing Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Printing Creative");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->MarketingScreen_CreativePrinting, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Marketing Staff");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->MarketingScreen_MktgStaff, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Advertising, Promotions, PR");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->MarketingScreen_PublicRelations, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");


    // This is for the operations.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Operations Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Equipment Rent");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_EquipmentRent, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Fence / Barrier");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_Fence, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Toilets");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_Kamode, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Laborers / Skilled Labor");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_Laborers, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Land Pred/Signs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_LandPrep, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Land Restoration");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_LandRestore, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Motor Homes, Trailer, Tarps");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_MotorHomes, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Operations Vehicles");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_OpsVehicles, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Perimeter Lights");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_PerimeterLights, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Petroleum Products");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_Petroleum, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Power/ Generator");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_PowerGenerator, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Shuttle Bus Rental");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_ShuttleBuses, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Site Operations Coordinator");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_SiteOpsCoordinator, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Venue, Land, and Parking Rent");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_VenueCost, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Water Trucks / Showers");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->OperationsScreen_WaterTrucks, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");


    // This is for the production stuff.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Production Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Ariel Lights");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->ProductionScreen_Aerials, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Backstage Food/Drink");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->ProductionScreen_Catering, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Lights");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->ProductionScreen_Lights, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Sound");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->ProductionScreen_Sound, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Stage, Tower, Canopy, Set");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->ProductionScreen_Stage, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Talent");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->ProductionScreen_Talent, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Light Towers,Strand Lights");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->ProductionScreen_LightTowers, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");


    // this is setting some stuff off our object.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Production Staff");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Production Staff/Stage Mgr.");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->StaffScreen_ProdStaff, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("StageHands and Assistants");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->StaffScreen_StageHands, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");


    // This is our security stuff.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Security Costs");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Communications");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->SecurityScreen_Communications, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("First Aid / Fire");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->SecurityScreen_FirstAid, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("IDs and Attire");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->SecurityScreen_Ids, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Security Staff");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->SecurityScreen_SecStaff, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Vehicles");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->SecurityScreen_Vehicles, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");

    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("TicketComm");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append(QString::number(this->TicketComm, 'f', 2));
    retHTML.append("</td>");
    retHTML.append("</tr>");


    // This is for the Artists.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Artists");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    for (int i = 0; i < this->Artists->count(); i++)
    {
        Artist *a = this->Artists->at(i);

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Artist Name");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->ArtistName);
        retHTML.append("</td>");
        retHTML.append("</tr>");
    }

    // This is for the PerformanceDates.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Performance Dates");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    for (int i = 0; i < this->PerformanceDates->count(); i++)
    {
        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append("Performance Date");
        retHTML.append("</td>");
        retHTML.append("</tr>");

        PerformanceDate *a = this->PerformanceDates->at(i);

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Start Date and Time");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->PerformanceStartDateTime.toString());
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("End Date and Time");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->PerformanceEndDateTime.toString());
        retHTML.append("</td>");
        retHTML.append("</tr>");
    }

    // This is for the TicketTiers.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Ticket Information");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    for (int i = 0; i < this->TicketTiers->count(); i++)
    {
        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append("Ticket");
        retHTML.append("</td>");
        retHTML.append("</tr>");

        Ticket *a = this->TicketTiers->at(i);

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Tier Name");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->TierName);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Tier Description");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->TierDescription);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Cost");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(QString::number(a->Cost));
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Number Available");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(QString::number(a->NumberAvailable));
        retHTML.append("</td>");
        retHTML.append("</tr>");
    }

    // This is for the Taxes.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Taxes");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    for (int i = 0; i < this->Taxes->count(); i++)
    {
        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append("Tax");
        retHTML.append("</td>");
        retHTML.append("</tr>");

        Tax *a = this->Taxes->at(i);

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Tax Name");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->TaxName);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Tax Rate");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(QString::number(a->TaxRate, 'f', 2));
        retHTML.append("</td>");
        retHTML.append("</tr>");
    }

    // This is for the Venues.
    retHTML.append("<tr>");
    retHTML.append("<td>");
    retHTML.append("Venues");
    retHTML.append("</td>");
    retHTML.append("<td>");
    retHTML.append("");
    retHTML.append("</td>");
    retHTML.append("</tr>");

    for (int i = 0; i < this->Venues->count(); i++)
    {
        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append("Venue");
        retHTML.append("</td>");
        retHTML.append("</tr>");

        Venue *a = this->Venues->at(i);

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Venue Name");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->VenueName);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Venue Address 1");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->VenueAddress1);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Venue Address 2");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->VenueAddress2);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Venue Address 3");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->VenueAddress3);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Venue City");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->VenueCity);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Venue Postal Code");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->VenuePostalCode);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Venue State");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->VenueState);
        retHTML.append("</td>");
        retHTML.append("</tr>");

        retHTML.append("<tr>");
        retHTML.append("<td>");
        retHTML.append("Venue Special Notes");
        retHTML.append("</td>");
        retHTML.append("<td>");
        retHTML.append(a->VenueSpecialNotes);
        retHTML.append("</td>");
        retHTML.append("</tr>");
    }

    retHTML.append("</table>");
    return retHTML;
}

QStringList ProtoolsStandard::GeneratePlainText()
{
    QStringList retHTML;
    retHTML.append(castring("Main"));

    // This is the show size.
    retHTML.append(castring("Production Size: ").append(this->Main_lblSize));
    retHTML.append(castring("Adminitsrative Costs: ").append(this->Main_lblAdminCosts));
    retHTML.append(castring("Marketing Costs: ").append(this->Main_lblMktgCosts));
    retHTML.append(castring("Operations Costs: ").append(this->Main_lblOpsCost));
    retHTML.append(castring("Production Costs: ").append(this->Main_lblProdCost));
    retHTML.append(castring("Security Costs: ").append(this->Main_lblSecCosts));
    retHTML.append(castring("Production Staff: ").append(this->Main_lblStaffCost));
    retHTML.append(castring("Subtotal Of Overhead: ").append(this->Main_lblSubTotal));
    retHTML.append(castring("Possible Number of Tickets: ").append(this->Main_lblTicketSalesPos));
    retHTML.append(castring("Possible Dollars: ").append(this->Main_lblPossibleDollars));
    retHTML.append(castring("Taxes Rate: ").append(this->Main_lblTax));
    retHTML.append(castring("Ticket Commission: ").append(this->Main_lblPossibleTicletCOmm));
    retHTML.append(castring("Net: ").append(this->Main_lblNet));

    // This is for the admin
    retHTML.append("");
    retHTML.append(castring("Administrative Costs"));
    retHTML.append(castring("Administrative Staff: ").append(QString::number(this->AdminScreen_AdminStaff, 'f', 2)));
    retHTML.append(castring("ASCAP, BMI, SESAC: ").append(QString::number(this->AdminScreen_ASCAP, 'f', 2)));
    retHTML.append(castring("Box Office Staff: ").append(QString::number(this->AdminScreen_BoxOffStaff, 'f', 2)));
    retHTML.append(castring("Insurance and Bonding: ").append(QString::number(this->AdminScreen_Insurance, 'f', 2)));
    retHTML.append(castring("Legal Accountant: ").append(QString::number(this->AdminScreen_LegalAccountant, 'f', 2)));
    retHTML.append(castring("Office Costs: ").append(QString::number(this->AdminScreen_OfficeCosts, 'f', 2)));
    retHTML.append(castring("Computers /Office Equipment: ").append(QString::number(this->AdminScreen_OfficeEquipment, 'f', 2)));
    retHTML.append(castring("Permits and Licenses: ").append(QString::number(this->AdminScreen_Permits, 'f', 2)));
    retHTML.append(castring("Telecommunications (Phone): ").append(QString::number(this->AdminScreen_Phones, 'f', 2)));
    retHTML.append(castring("Postage: ").append(QString::number(this->AdminScreen_Postage, 'f', 2)));
    retHTML.append(castring("Office Rent, Power, Lights: ").append(QString::number(this->AdminScreen_RentPower, 'f', 2)));
    retHTML.append(castring("Ticket Printing: ").append(QString::number(this->AdminScreen_Ticketprinting, 'f', 2)));
    retHTML.append(castring("Ticket Takers: ").append(QString::number(this->AdminScreen_TicketTakers, 'f', 2)));
    retHTML.append(castring("Traffic Control: ").append(QString::number(this->AdminScreen_TrafficControl, 'f', 2)));

    // This is for the marketing.
    retHTML.append("");
    retHTML.append(castring("Marketing Costs"));
    retHTML.append(castring("Printing Creative: ").append(QString::number(this->MarketingScreen_CreativePrinting, 'f', 2)));
    retHTML.append(castring("Marketing Staff: ").append(QString::number(this->MarketingScreen_MktgStaff, 'f', 2)));
    retHTML.append(castring("Advertising, Promotions, PR: ").append(QString::number(this->MarketingScreen_PublicRelations, 'f', 2)));

    // This is for the operations.
    retHTML.append("");
    retHTML.append(castring("Operations Costs"));
    retHTML.append(castring("Equipment Rent: ").append(QString::number(this->OperationsScreen_EquipmentRent, 'f', 2)));
    retHTML.append(castring("Fence / Barrier: ").append(QString::number(this->OperationsScreen_Fence, 'f', 2)));
    retHTML.append(castring("Toilets: ").append(QString::number(this->OperationsScreen_Kamode, 'f', 2)));
    retHTML.append(castring("Laborers / Skilled Labor: ").append(QString::number(this->OperationsScreen_Laborers, 'f', 2)));
    retHTML.append(castring("Land Pred/Signs: ").append(QString::number(this->OperationsScreen_LandPrep, 'f', 2)));
    retHTML.append(castring("Land Restoration: ").append(QString::number(this->OperationsScreen_LandRestore, 'f', 2)));
    retHTML.append(castring("Motor Homes, Trailer, Tarps: ").append(QString::number(this->OperationsScreen_MotorHomes, 'f', 2)));
    retHTML.append(castring("Operations Vehicles: ").append(QString::number(this->OperationsScreen_OpsVehicles, 'f', 2)));
    retHTML.append(castring("Perimeter Lights: ").append(QString::number(this->OperationsScreen_PerimeterLights, 'f', 2)));
    retHTML.append(castring("Petroleum Products: ").append(QString::number(this->OperationsScreen_Petroleum, 'f', 2)));
    retHTML.append(castring("Power/ Generator: ").append(QString::number(this->OperationsScreen_PowerGenerator, 'f', 2)));
    retHTML.append(castring("Shuttle Bus Rental: ").append(QString::number(this->OperationsScreen_ShuttleBuses, 'f', 2)));
    retHTML.append(castring("Site Operations Coordinator: ").append(QString::number(this->OperationsScreen_SiteOpsCoordinator, 'f', 2)));
    retHTML.append(castring("Venue, Land, and Parking Rent: ").append(QString::number(this->OperationsScreen_VenueCost, 'f', 2)));
    retHTML.append(castring("Water Trucks / Showers: ").append(QString::number(this->OperationsScreen_WaterTrucks, 'f', 2)));

    // This is for the production stuff.
    retHTML.append("");
    retHTML.append(castring("Production Costs"));
    retHTML.append(castring("Ariel Lights: ").append(QString::number(this->ProductionScreen_Aerials, 'f', 2)));
    retHTML.append(castring("Backstage Food/Drink: ").append(QString::number(this->ProductionScreen_Catering, 'f', 2)));
    retHTML.append(castring("Lights: ").append(QString::number(this->ProductionScreen_Lights, 'f', 2)));
    retHTML.append(castring("Sound: ").append(QString::number(this->ProductionScreen_Sound, 'f', 2)));
    retHTML.append(castring("Stage, Tower, Canopy, Set: ").append(QString::number(this->ProductionScreen_Stage, 'f', 2)));
    retHTML.append(castring("Talent: ").append(QString::number(this->ProductionScreen_Talent, 'f', 2)));
    retHTML.append(castring("Light Towers,Strand Lights: ").append(QString::number(this->ProductionScreen_LightTowers, 'f', 2)));

    // this is setting some stuff off our object.
    retHTML.append("");
    retHTML.append(castring("Production Staff"));
    retHTML.append(castring("Production Staff/Stage Mgr.: ").append(QString::number(this->StaffScreen_ProdStaff, 'f', 2)));
    retHTML.append(castring("StageHands and Assistants: ").append(QString::number(this->StaffScreen_StageHands, 'f', 2)));

    // This is our security stuff.
    retHTML.append("");
    retHTML.append(castring("Security Costs"));
    retHTML.append(castring("Communications: ").append(QString::number(this->SecurityScreen_Communications, 'f', 2)));
    retHTML.append(castring("First Aid / Fire: ").append(QString::number(this->SecurityScreen_FirstAid, 'f', 2)));
    retHTML.append(castring("IDs and Attire: ").append(QString::number(this->SecurityScreen_Ids, 'f', 2)));
    retHTML.append(castring("Security Staff: ").append(QString::number(this->SecurityScreen_SecStaff, 'f', 2)));
    retHTML.append(castring("Vehicles: ").append(QString::number(this->SecurityScreen_Vehicles, 'f', 2)));
    retHTML.append(castring("Ticket Commmission: ").append(QString::number(this->TicketComm, 'f', 2)));

    // This is for the Artists.
    retHTML.append("");
    retHTML.append(castring("Artists"));

    for (int i = 0; i < this->Artists->count(); i++)
    {
        Artist *a = this->Artists->at(i);

        retHTML.append(castring("Artist Name: ").append(a->ArtistName));
    }

    // This is for the PerformanceDates.
    retHTML.append("");
    retHTML.append(castring("Performance Dates"));

    for (int i = 0; i < this->PerformanceDates->count(); i++)
    {
        retHTML.append(castring("Performance Date"));

        PerformanceDate *a = this->PerformanceDates->at(i);

        retHTML.append(castring("Start Date and Time: ").append(a->PerformanceStartDateTime.toString()));
        retHTML.append(castring("End Date and Time: ").append(a->PerformanceEndDateTime.toString()));
    }

    // This is for the TicketTiers.
    retHTML.append("");
    retHTML.append(castring("Ticket Information"));

    for (int i = 0; i < this->TicketTiers->count(); i++)
    {
        retHTML.append(castring("Ticket"));

        Ticket *a = this->TicketTiers->at(i);

        retHTML.append(castring("Tier Name: ").append(a->TierName));
        retHTML.append(castring("Tier Description: ").append(a->TierDescription));
        retHTML.append(castring("Cost: ").append(QString::number(a->Cost)));
        retHTML.append(castring("Number Available: ").append(QString::number(a->NumberAvailable)));
    }

    // This is for the Taxes.
    retHTML.append("");
    retHTML.append(castring("Taxes"));

    for (int i = 0; i < this->Taxes->count(); i++)
    {
        retHTML.append(castring("Tax"));

        Tax *a = this->Taxes->at(i);

        retHTML.append(castring("Tax Name: ").append(a->TaxName));
        retHTML.append(castring("Tax Rate: ").append(QString::number(a->TaxRate, 'f', 2)));
    }

    // This is for the Venues.
    retHTML.append("");
    retHTML.append(castring("Venues"));

    for (int i = 0; i < this->Venues->count(); i++)
    {
        retHTML.append(castring("Venue"));

        Venue *a = this->Venues->at(i);

        retHTML.append(castring("Venue Name: ").append(a->VenueName));
        retHTML.append(castring("Venue Address 1: ").append(a->VenueAddress1));
        retHTML.append(castring("Venue Address 2: ").append(a->VenueAddress2));
        retHTML.append(castring("Venue Address 3: ").append(a->VenueAddress3));
        retHTML.append(castring("Venue City: ").append(a->VenueCity));
        retHTML.append(castring("Venue Postal Code: ").append(a->VenuePostalCode));
        retHTML.append(castring("Venue State: ").append(a->VenueState));
        retHTML.append(castring("Venue Special Notes: ").append(a->VenueSpecialNotes));
    }

    return retHTML;
}

void ProtoolsStandard::RecalculateProtoolsObject()
{
    // This is going to do the math for the main screen.
    if (ProductionSize == ProtoolsStandard::SMALL_CONCERT)
    {
        Main_lblSize = castring("Small Concert");
    }
    else if(ProductionSize == ProtoolsStandard::LARGE_CONCERT)
    {
        Main_lblSize = castring("Large Concert");
    }
    else if(ProductionSize == ProtoolsStandard::SMALL_FESTIVAL)
    {
        Main_lblSize = castring("Small Festival");
    }
    else if(ProductionSize == ProtoolsStandard::LARGE_FESTIVAL)
    {
        Main_lblSize = castring("Large Festival");
    }

    double fltTemp = 0.00;

    // This is going to production costs.
    fltTemp = ProductionScreen_Talent +
            ProductionScreen_Sound +
            ProductionScreen_Lights +
            ProductionScreen_Catering +
            ProductionScreen_Stage +
            ProductionScreen_LightTowers +
            ProductionScreen_Aerials;

     this->Main_lblProdCost = QString::number(fltTemp,'f', 2);

    // This is for our staff costs.
    fltTemp = StaffScreen_ProdStaff + StaffScreen_StageHands;

    this->Main_lblStaffCost = QString::number(fltTemp,'f', 2);

                // This is for our admin costs.
    fltTemp = AdminScreen_AdminStaff +
            AdminScreen_BoxOffStaff +
            AdminScreen_TicketTakers +
            AdminScreen_TrafficControl +
            AdminScreen_OfficeCosts +
            AdminScreen_OfficeEquipment +
            AdminScreen_Postage +
            AdminScreen_Phones +
            AdminScreen_LegalAccountant +
            AdminScreen_RentPower +
            AdminScreen_Insurance +
            AdminScreen_Permits +
            AdminScreen_ASCAP +
            AdminScreen_Ticketprinting;

    this->Main_lblAdminCosts = QString::number(fltTemp,'f', 2);

    // This is for the marketing costs.
    fltTemp = MarketingScreen_PublicRelations +
            MarketingScreen_CreativePrinting +
            MarketingScreen_MktgStaff;

    this->Main_lblMktgCosts = QString::number(fltTemp,'f', 2);

    // This is out security costs.
    fltTemp = SecurityScreen_SecStaff +
            SecurityScreen_Vehicles +
            SecurityScreen_FirstAid +
            SecurityScreen_Communications +
            SecurityScreen_Ids;

    this->Main_lblSecCosts = QString::number(fltTemp,'f', 2);

    // This is for our operations screen.
    fltTemp = OperationsScreen_SiteOpsCoordinator +
            OperationsScreen_Laborers +
            OperationsScreen_VenueCost +
            OperationsScreen_LandRestore +
            OperationsScreen_Kamode +
            OperationsScreen_WaterTrucks +
            OperationsScreen_EquipmentRent +
            OperationsScreen_Petroleum +
            OperationsScreen_PowerGenerator +
            OperationsScreen_PerimeterLights +
            OperationsScreen_Fence +
            OperationsScreen_OpsVehicles +
            OperationsScreen_ShuttleBuses +
            OperationsScreen_MotorHomes +
            OperationsScreen_LandPrep;

    this->Main_lblOpsCost = QString::number(fltTemp,'f', 2);

    // This is out subtotal
    fltTemp = ProductionScreen_Talent +
            ProductionScreen_Sound +
            ProductionScreen_Lights +
            ProductionScreen_Catering +
            ProductionScreen_Stage +
            ProductionScreen_LightTowers +
            ProductionScreen_Aerials +

            StaffScreen_ProdStaff +
            StaffScreen_StageHands +

            AdminScreen_AdminStaff +
            AdminScreen_BoxOffStaff +
            AdminScreen_TicketTakers +
            AdminScreen_TrafficControl +
            AdminScreen_OfficeCosts +
            AdminScreen_OfficeEquipment +
            AdminScreen_Postage +
            AdminScreen_Phones +
            AdminScreen_LegalAccountant +
            AdminScreen_RentPower +
            AdminScreen_Insurance +
            AdminScreen_Permits +
            AdminScreen_ASCAP +
            AdminScreen_Ticketprinting +

            MarketingScreen_PublicRelations +
            MarketingScreen_CreativePrinting +
            MarketingScreen_MktgStaff +

            SecurityScreen_SecStaff +
            SecurityScreen_Vehicles +
            SecurityScreen_FirstAid +
            SecurityScreen_Communications +
            SecurityScreen_Ids +

            OperationsScreen_SiteOpsCoordinator +
            OperationsScreen_Laborers +
            OperationsScreen_VenueCost +
            OperationsScreen_LandRestore +
            OperationsScreen_Kamode +
            OperationsScreen_WaterTrucks +
            OperationsScreen_EquipmentRent +
            OperationsScreen_Petroleum +
            OperationsScreen_PowerGenerator +
            OperationsScreen_PerimeterLights +
            OperationsScreen_Fence +
            OperationsScreen_OpsVehicles +
            OperationsScreen_ShuttleBuses +
            OperationsScreen_MotorHomes +
            OperationsScreen_LandPrep;

    this->Main_lblSubTotal = QString::number(fltTemp,'f', 2);

    // This is going to tack on the artists into the line edit.
    int intArrLen = 0;
    intArrLen = this->Artists->length();
    QString s = castring("");

    for(int i = 0; i < intArrLen; i++)
    {
        if (i != 0)
        {
            s.append(castring(","));
        }

        s.append(this->Artists->at(i)->ArtistName);
    }

    this->Main_lblArtists = s;

    // This is the venues.
    intArrLen = 0;
    intArrLen = this->Venues->length();
    s = castring("");

    for(int i = 0; i < intArrLen; i++)
    {
        if (i != 0)
        {
            s.append(castring(","));
        }

        s.append(this->Venues->at(i)->VenueName);
    }

    this->Main_lblVenues = s;

    // This is the performance dates.
    intArrLen = 0;
    intArrLen = this->PerformanceDates->length();
    s = castring("");

    for(int i = 0; i < intArrLen; i++)
    {
        if (i != 0)
        {
            s.append(castring(","));
        }

        s.append(this->PerformanceDates->at(i)->PerformanceStartDateTime.toString(Qt::SystemLocaleLongDate));
        s.append(castring("-"));
        s.append(this->PerformanceDates->at(i)->PerformanceEndDateTime.toString(Qt::SystemLocaleLongDate));
    }

    this->Main_lblPerformaceDates = s;

    // This is the tickets.
    // This need to be a running talley since
    // the ticket prices and counts differ.
    intArrLen = 0;
    int intTicketCount = 0;
    double fltTicketCost = 0.00;
    double fltPossibleDollars = 0.00;
    intArrLen = this->TicketTiers->length();
    s = castring("");

    for(int i = 0; i < intArrLen; i++)
    {
        intTicketCount = this->TicketTiers->at(i)->NumberAvailable;
        fltTicketCost = this->TicketTiers->at(i)->Cost;
        fltPossibleDollars = fltPossibleDollars + (fltTicketCost * intTicketCount);
    }

    this->Main_TicketCount = QString::number(intTicketCount);

    this->Main_lblTicketSalesPos = QString::number(fltPossibleDollars, 'f', 2);

    double fltTicketComm = 0.00;
    fltTicketComm = this->TicketComm;

    // This is the taxes.
    intArrLen = 0;
    intArrLen = this->Taxes->length();
    s = castring("");

    double fltTaxRates = 0.00;

    for(int i = 0; i < intArrLen; i++)
    {
        fltTaxRates = fltTaxRates + this->Taxes->at(i)->TaxRate;
    }

    // This is the final calculations.
    fltTaxRates = fltTaxRates / 100.00;
    fltTicketComm = fltTicketComm / 100.00;

    double fltTotal = 0.00;
    fltTotal = fltPossibleDollars;

    this->Main_lblTax = QString::number((fltTotal * fltTaxRates), 'f', 2);

    fltTotal = fltTotal - (fltTotal * fltTaxRates);
    this->Main_lblPossibleTicletCOmm = QString::number((fltTotal * fltTicketComm), 'f', 2);

    fltTotal = fltTotal - (fltTotal * fltTicketComm);
    fltTotal = fltTotal - fltTemp;
    this->Main_lblNet = QString::number(fltTotal, 'f', 2);
}

bool ProtoolsStandard::ExportToPDF(const QString &fileName)
{
    int intCounter = 25;
    QStringList plainText;
    plainText = this->GeneratePlainText();

    QPrinter printer;
    printer.setOutputFormat(QPrinter::PdfFormat);
    printer.setOutputFileName(fileName);
    QPainter painter;

    if (! painter.begin(&printer))
    {
        return false;
    }

    painter.drawText(10, 10, "Production Report");

    for(int i = 0; i < plainText.length(); i++)
    {
        QString tmp = plainText.at(i);

        //painter.drawRect(10, intCounter, 30, 35);
        painter.drawText(10, intCounter, tmp);
        intCounter = intCounter + 15;
        if (intCounter >= 990)
        {
            intCounter = 20;

            if (! printer.newPage()) {
                return false;
            }
        }
    }

    painter.end();
    return true;
}

bool ProtoolsStandard::ExportToText(const QString &fileName)
{
    QStringList plainText;

    plainText.append(this->GeneratePlainText());

    QFile data(fileName);
    if (data.open(QFile::WriteOnly | QFile::Truncate))
    {
        QTextStream out(&data);

        for (int i = 0; i < plainText.length(); i++)
        {
            out << plainText.at(i);
            out << "\n";
        }

        out.flush();
        data.close();
    }

    return true;
}

bool ProtoolsStandard::ExportToHTML(const QString &fileName)
{
    QStringList plainText;

    plainText.append("<html><head></head><body>");
    plainText.append(this->GenerateHTML());
    plainText.append("</body></html>");

    QFile data(fileName);
    if (data.open(QFile::WriteOnly | QFile::Truncate))
    {
        QTextStream out(&data);

        for (int i = 0; i < plainText.length(); i++)
        {
            out << plainText.at(i);
        }

        out.flush();
        data.close();
    }

    return true;
}

bool ProtoolsStandard::OpenFile(const QString &fileName)
{
    QFile file(fileName);
    if (!file.open(QFile::ReadOnly | QFile::Text))
    {
        return false;
    }

    // Now we are going to read the file.
    QTextStream stream(&file);
    QString line;
    Artist *a;
    PerformanceDate *p;
    Ticket *t;
    Tax *ta;
    Venue *v;

    do {
         line = stream.readLine();

         // This is the show size.
         if (line.startsWith("ProductionSize:"))
         {
             this->ProductionSize = line.replace("ProductionSize:", "", Qt::CaseInsensitive).toInt();

             if (ProductionSize == ProtoolsStandard::SMALL_CONCERT)
             {
                 Main_lblSize = castring("Small Concert");
             }
             else if(ProductionSize == ProtoolsStandard::LARGE_CONCERT)
             {
                 Main_lblSize = castring("Large Concert");
             }
             else if(ProductionSize == ProtoolsStandard::SMALL_FESTIVAL)
             {
                 Main_lblSize = castring("Small Festival");
             }
             else if(ProductionSize == ProtoolsStandard::LARGE_FESTIVAL)
             {
                 Main_lblSize = castring("Large Festival");
             }
         }

         // This is for the admin
         if (line.startsWith("AdminScreen_AdminStaff:"))
         {
             this->AdminScreen_AdminStaff = line.replace("AdminScreen_AdminStaff:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_ASCAP:"))
         {
             this->AdminScreen_ASCAP = line.replace("AdminScreen_ASCAP:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_BoxOffStaff:"))
         {
             this->AdminScreen_BoxOffStaff = line.replace("AdminScreen_BoxOffStaff:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_Insurance:"))
         {
             this->AdminScreen_Insurance = line.replace("AdminScreen_Insurance:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_LegalAccountant:"))
         {
             this->AdminScreen_LegalAccountant = line.replace("AdminScreen_LegalAccountant:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_OfficeCosts:"))
         {
             this->AdminScreen_OfficeCosts = line.replace("AdminScreen_OfficeCosts:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_OfficeEquipment:"))
         {
             this->AdminScreen_OfficeEquipment = line.replace("AdminScreen_OfficeEquipment:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_Permits:"))
         {
             this->AdminScreen_Permits = line.replace("AdminScreen_Permits:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_Phones:"))
         {
             this->AdminScreen_Phones = line.replace("AdminScreen_Phones:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_Postage:"))
         {
             this->AdminScreen_Postage = line.replace("AdminScreen_Postage:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_RentPower:"))
         {
             this->AdminScreen_RentPower = line.replace("AdminScreen_RentPower:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_Ticketprinting:"))
         {
             this->AdminScreen_Ticketprinting = line.replace("AdminScreen_Ticketprinting:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_TicketTakers:"))
         {
             this->AdminScreen_TicketTakers = line.replace("AdminScreen_TicketTakers:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("AdminScreen_TrafficControl:"))
         {
             this->AdminScreen_TrafficControl = line.replace("AdminScreen_TrafficControl:", "", Qt::CaseInsensitive).toDouble();
         }

         // This is for the marketing.
         if (line.startsWith("MarketingScreen_CreativePrinting:"))
         {
             this->MarketingScreen_CreativePrinting = line.replace("MarketingScreen_CreativePrinting:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("MarketingScreen_MktgStaff:"))
         {
             this->MarketingScreen_MktgStaff = line.replace("MarketingScreen_MktgStaff:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("MarketingScreen_PublicRelations:"))
         {
             this->MarketingScreen_PublicRelations = line.replace("MarketingScreen_PublicRelations:", "", Qt::CaseInsensitive).toDouble();
         }

         // This is for the operations.
         if (line.startsWith("OperationsScreen_EquipmentRent:"))
         {
             this->OperationsScreen_EquipmentRent = line.replace("OperationsScreen_EquipmentRent:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_Fence:"))
         {
             this->OperationsScreen_Fence = line.replace("OperationsScreen_Fence:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_Kamode:"))
         {
             this->OperationsScreen_Kamode = line.replace("OperationsScreen_Kamode:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_Laborers:"))
         {
             this->OperationsScreen_Laborers = line.replace("OperationsScreen_Laborers:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_LandPrep:"))
         {
             this->OperationsScreen_LandPrep = line.replace("OperationsScreen_LandPrep:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_LandRestore:"))
         {
             this->OperationsScreen_LandRestore = line.replace("OperationsScreen_LandRestore:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_MotorHomes:"))
         {
             this->OperationsScreen_MotorHomes = line.replace("OperationsScreen_MotorHomes:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_OpsVehicles:"))
         {
             this->OperationsScreen_OpsVehicles = line.replace("OperationsScreen_OpsVehicles:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_PerimeterLights:"))
         {
             this->OperationsScreen_PerimeterLights = line.replace("OperationsScreen_PerimeterLights:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_Petroleum:"))
         {
             this->OperationsScreen_Petroleum = line.replace("OperationsScreen_Petroleum:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_PowerGenerator:"))
         {
             this->OperationsScreen_PowerGenerator = line.replace("OperationsScreen_PowerGenerator:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_ShuttleBuses:"))
         {
             this->OperationsScreen_ShuttleBuses = line.replace("OperationsScreen_ShuttleBuses:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_SiteOpsCoordinator:"))
         {
             this->OperationsScreen_SiteOpsCoordinator = line.replace("OperationsScreen_SiteOpsCoordinator:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_VenueCost:"))
         {
             this->OperationsScreen_VenueCost = line.replace("OperationsScreen_VenueCost:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("OperationsScreen_WaterTrucks:"))
         {
             this->OperationsScreen_WaterTrucks = line.replace("OperationsScreen_WaterTrucks:", "", Qt::CaseInsensitive).toDouble();
         }

         // This is for the production stuff.
         if (line.startsWith("ProductionScreen_LightTowers:"))
         {
             this->ProductionScreen_LightTowers = line.replace("ProductionScreen_LightTowers:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("ProductionScreen_Aerials:"))
         {
             this->ProductionScreen_Aerials = line.replace("ProductionScreen_Aerials:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("ProductionScreen_Catering:"))
         {
             this->ProductionScreen_Catering = line.replace("ProductionScreen_Catering:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("ProductionScreen_Lights:"))
         {
             this->ProductionScreen_Lights = line.replace("ProductionScreen_Lights:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("ProductionScreen_Sound:"))
         {
             this->ProductionScreen_Sound = line.replace("ProductionScreen_Sound:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("ProductionScreen_Stage:"))
         {
             this->ProductionScreen_Stage = line.replace("ProductionScreen_Stage:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("ProductionScreen_Talent:"))
         {
             this->ProductionScreen_Talent = line.replace("ProductionScreen_Talent:", "", Qt::CaseInsensitive).toDouble();
         }

         // This is our security stuff.
         if (line.startsWith("SecurityScreen_Communications:"))
         {
             this->SecurityScreen_Communications = line.replace("SecurityScreen_Communications:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("SecurityScreen_FirstAid:"))
         {
             this->SecurityScreen_FirstAid = line.replace("SecurityScreen_FirstAid:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("SecurityScreen_Ids:"))
         {
             this->SecurityScreen_Ids = line.replace("SecurityScreen_Ids:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("SecurityScreen_SecStaff:"))
         {
             this->SecurityScreen_SecStaff = line.replace("SecurityScreen_SecStaff:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("SecurityScreen_Vehicles:"))
         {
             this->SecurityScreen_Vehicles = line.replace("SecurityScreen_Vehicles:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("TicketComm:"))
         {
             this->TicketComm = line.replace("TicketComm:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("StaffScreen_ProdStaff:"))
         {
             this->StaffScreen_ProdStaff = line.replace("StaffScreen_ProdStaff:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("StaffScreen_StageHands:"))
         {
             this->StaffScreen_StageHands = line.replace("StaffScreen_StageHands:", "", Qt::CaseInsensitive).toDouble();
         }

         // This is for the Artists.
         if (line.startsWith("Artist:"))
         {
             a = new Artist;
         }

         if (line.startsWith("ArtistName:"))
         {
             a->ArtistName = line.replace("ArtistName:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("EndArtist:"))
         {
             this->Artists->append(a);
         }

         // This is for the performance dates.
         if (line.startsWith("Performance Date:"))
         {
             p = new PerformanceDate;
         }

         if (line.startsWith("PerformanceStartDateTime:"))
         {
             p->PerformanceStartDateTime.fromString(line.replace("PerformanceStartDateTime:", "", Qt::CaseInsensitive));
         }

         if (line.startsWith("PerformanceEndDateTime:"))
         {
            p->PerformanceEndDateTime.fromString(line.replace("PerformanceEndDateTime:", "", Qt::CaseInsensitive));
         }

         if (line.startsWith("EndPerf:"))
         {
             this->PerformanceDates->append(p);
             QString s = castring("");
             s.append(p->PerformanceStartDateTime.toString(Qt::SystemLocaleLongDate));
             s.append("-");
             s.append(p->PerformanceEndDateTime.toString(Qt::SystemLocaleLongDate));
         }

         // This is for the TicketTiers.
         if (line.startsWith("Ticket:"))
         {
             t = new Ticket;
         }

         if (line.startsWith("TierName:"))
         {
             t->TierName = line.replace("TierName:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("TierDescription:"))
         {
            t->TierDescription = line.replace("TierDescription:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("Cost:"))
         {
            t->Cost = line.replace("Cost:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("NumberAvailable:"))
         {
            t->NumberAvailable = line.replace("NumberAvailable:", "", Qt::CaseInsensitive).toInt();
         }

         if (line.startsWith("EndTicket:"))
         {
             this->TicketTiers->append(t);
         }

         // This is for the Taxes.
         if (line.startsWith("Tax:"))
         {
             ta = new Tax;
         }

         if (line.startsWith("TaxName:"))
         {
             ta->TaxName = line.replace("TaxName:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("TaxRate:"))
         {
            ta->TaxRate = line.replace("TaxRate:", "", Qt::CaseInsensitive).toDouble();
         }

         if (line.startsWith("EndTax:"))
         {
             this->Taxes->append(ta);
         }

         // This is for the Venues.
         if (line.startsWith("Venue:"))
         {
             v = new Venue;
         }

         if (line.startsWith("VenueAddress1:"))
         {
             v->VenueAddress1 = line.replace("VenueAddress1:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("VenueAddress2:"))
         {
            v->VenueAddress2 = line.replace("VenueAddress2:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("VenueAddress3:"))
         {
            v->VenueAddress3 = line.replace("VenueAddress3:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("VenueCity:"))
         {
            v->VenueCity = line.replace("VenueCity:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("VenueName:"))
         {
            v->VenueName = line.replace("VenueName:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("VenuePostalCode:"))
         {
            v->VenuePostalCode = line.replace("VenuePostalCode:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("VenueSpecialNotes:"))
         {
            v->VenueSpecialNotes = line.replace("VenueSpecialNotes:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("VenueState:"))
         {
            v->VenueState = line.replace("VenueState:", "", Qt::CaseInsensitive);
         }

         if (line.startsWith("EndVenue:"))
         {
             this->Venues->append(v);
         }
    } while (!line.isNull());

    file.close();

    return true;
}
